package com.suptrack.web.servlet.admin;

import java.io.IOException;
import java.util.List;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.suptrack.entity.User;
import com.suptrack.service.UserService;

/**
 * Servlet implementation class AdminServlet
 */
@WebServlet("/RegisteredContent/Admin/AdminPanel")
public class AdminServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	@EJB
	UserService userservice;
	
       
  
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<User> listuser = userservice.getAllUser();
		request.setAttribute("listUser", listuser);	
		request.getRequestDispatcher("/RegisteredContent/Admin/AdminPanel.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
